home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.01 Jan 90 / XDemo Source / XDemo.r < prev    next >
Encoding:
Text File  |  1989-08-06  |  2.1 KB  |  150 lines  |  [TEXT/MPS ]

  1. /*----------- XDemo.r ----------------*/
  2. /*by Mark Lankton, 1989 for Mac Tutor */
  3. #include "Types.r"
  4.  
  5. #define AllItems    0x7FFFFFFF    /* 31 flags */
  6. #define MenuItem1    0b00001
  7. #define MenuItem2    0b00010
  8.  
  9. type 'XDEM' as 'STR ';
  10.  
  11. /* menus */
  12. resource 'MENU' (128, "Apple", preload) {
  13.     128, textMenuProc,
  14.     AllItems & ~MenuItem2,    /* Disable item #2 */
  15.     enabled, apple,
  16.     {
  17.         /* 1 */
  18.         "About This…",
  19.             noicon, nokey, nomark, plain;
  20.             
  21.         /* 2 */
  22.         "-",
  23.             noicon, nokey, nomark, plain
  24.     }
  25. };
  26.  
  27. resource 'MENU' (129, "File", preload) {
  28.     129, textMenuProc,
  29.     AllEnabled,
  30.     enabled, "File",
  31.     {
  32.         /* 1 */
  33.         "New",
  34.             noicon, "N", nomark, plain;
  35.             
  36.         /* 2 */
  37.         "Close",
  38.             noicon, "W", nomark, plain;
  39.             
  40.         /* 3 */
  41.         "Quit",
  42.             noicon, "Q", nomark, plain
  43.     }
  44. };
  45.  
  46. resource 'MENU' (130, "Edit", preload) {
  47.     130, textMenuProc,
  48.     AllItems & ~(MenuItem2),    
  49.     enabled, "Edit",
  50.      {
  51.          /* 1 */
  52.         "Undo",
  53.             noicon, "Z", nomark, plain;
  54.         
  55.         /* 2 */
  56.         "-",
  57.             noicon, nokey, nomark, plain;
  58.             
  59.         /* 3 */
  60.         "Cut",
  61.             noicon, "X", nomark, plain;
  62.             
  63.         /* 4 */
  64.         "Copy",
  65.             noicon, "C", nomark, plain;
  66.             
  67.         /* 5 */
  68.         "Paste",
  69.             noicon, "V", nomark, plain
  70.         
  71.     }
  72. };
  73.  
  74.  
  75. resource 'MENU' (131,"Externals") {
  76.     131,textMenuProc,
  77.     AllEnabled,
  78.     enabled,"Externals",
  79.     {
  80.     /*No items here until start-up time! */
  81.     }
  82. };
  83.  
  84.  
  85. /* Windows */
  86.  
  87. resource 'WIND' (128) {
  88.     {40, 10, 200, 200},
  89.     zoomDocProc,
  90.     invisible,
  91.     goAway,
  92.     0x0,
  93.     "The Data"
  94. };
  95.  
  96. /* DLOG */
  97. resource 'DLOG' (128) {
  98.     {40, 40, 240, 380},
  99.     dBoxProc,
  100.     visible,
  101.     goAway,
  102.     0x0,
  103.     128,
  104.     ""
  105. };
  106.  
  107. resource 'DITL' (128) {
  108.     {    /* array DITLarray: 2 elements */
  109.         /* [1] */
  110.         {67, 56, 85, 289},
  111.         StaticText {
  112.             disabled,
  113.             "External function demo program"
  114.         },
  115.         /* [2] */
  116.         {110, 90, 152, 253},
  117.         StaticText {
  118.             disabled,
  119.             "by Mark Lankton, 1989, for MacTutor."
  120.         }
  121.     }
  122. };
  123.  
  124.  
  125. /* SIZE */
  126. resource 'SIZE' (-1) {
  127.     dontSaveScreen,
  128.     acceptSuspendResumeEvents,
  129.     enableOptionSwitch,
  130.     canBackground,            
  131.     multiFinderAware,    
  132.     backgroundAndForeground,
  133.     dontGetFrontClicks,
  134.     ignoreChildDiedEvents,
  135.     is32BitCompatible,
  136.     reserved,
  137.     reserved,
  138.     reserved,
  139.     reserved,
  140.     reserved,
  141.     reserved,
  142.     reserved,    
  143.     24576,
  144.     24576
  145. };
  146.  
  147.  
  148. resource 'XDEM' (0) {
  149.     "Demo of external function tricks for MacTutor, 8/89"
  150. };